POST
/
v1
/
promotion-codes
curl --request POST \
  --url https://api.hyperline.co/v1/promotion-codes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "code": "PROMO123",
  "coupon_id": "cou_DKL4Xcb5VSa8CQ",
  "customer_id": "cus_DKL4Xcb5VSa8CQ",
  "plan_id": "plan_DKL4Xcb5VSa8CQ",
  "product_id": "itm_DKL4Xcb5VSa8CQ",
  "expires_at": "2021-01-01T00:00:00.000Z",
  "max_redemptions": 10,
  "current_redemptions": 0,
  "duration_count": 1,
  "duration_period": "months",
  "only_for_first_time_order": false
}'
{
  "id": "promo_DKL4Xcb5VSa8CQ",
  "code": "PROMO123",
  "coupon_id": "cou_DKL4Xcb5VSa8CQ",
  "client_id": "cli_DKL4Xcb5VSa8CQ",
  "customer_id": "cus_DKL4Xcb5VSa8CQ",
  "plan_id": "plan_DKL4Xcb5VSa8CQ",
  "product_id": "itm_DKL4Xcb5VSa8CQ",
  "created_at": "2021-01-01T00:00:00.000Z",
  "updated_at": "2021-01-01T00:00:00.000Z",
  "expires_at": "2021-01-01T00:00:00.000Z",
  "max_redemptions": 10,
  "current_redemptions": 0,
  "duration_count": 1,
  "duration_period": "months",
  "only_for_first_time_order": false
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Create promotion code payload

The body is of type object.

Response

201 - application/json

The newly created promotion code

The response is of type object.